﻿{extends file="../home.html"}

{block name="title"}{$head_title}{/block}
	
{block name="css"}
{/block}

{block name="content"}
<!--s主内容-->
<section class="content-wrapper">
  <div class="content-container container">
  	<!-- s面包屑导航 -->
  	{include file="../breadcrum_nav.html"}
  	<!-- e面包屑导航 -->
    <!-- s分类 -->
    <div class="col-left">
    {include file="../common_personal_nav.html"}
	</div>	
    <!-- e分类 -->
    <!-- s主内容 -->
    <div class="col-main">
		{include file="../common_personal_header.html"}
		<div class="user-main">
			<!-- s我的收藏数量 -->
			<h6 class="form-title mb20">我的收藏<span class="ml10 fs12">共收藏<span class="red" id="total">{$total}</span>个商品</span></h6>
			<!-- e我的收藏数量 -->
			<!-- s我的收藏列表 -->
			{if $collect_list}
			<table class="mt20 table">
				<thead>
					<tr>
						<th>我的收藏列表</th>
					</tr>
				</thead>
				<thead>
					<tr>
						<th>图片</th>
						<th>商品名称</th>
						<th>商品价格</th>
						<th>状态</th>
						<th>操作</th>
					</tr>
				</thead>
		        <tbody>
		        {foreach from=$collect_list item=collect}
		          <tr>
		            <td><img src="{$collect.small_pic}" alt="{$collect.item_name}" class="clt-img"></td>
		            <td><a href="{if $collect.is_gift}{$integral_item_detail_link}{$collect.item_id}{else}{$item_detail_link}{$collect.item_id}{/if}">{$collect.item_name}</a></td>
		            <td>￥{$collect.mall_price}</td>
		            <td>{$collect.status}</td>
		            <td>
		            	<a href="javascript:;" class="btn del-addr">删除</a>
		           	 	<input type="hidden" id="item_id" value="{$collect.item_id}">
		            </td>
		          </tr>
		        {/foreach}
		        </tbody>
		      </table>
		      <!-- 分页 -->
		      <div class="pagination">
		        <ul>{$show}</ul>
		      </div>
		      {else}
			  <div class="error_content">
			  	暂无收藏
			  </div>
		      {/if}
		      <!-- e我的收藏列表 -->
		</div>
	</div>
	<div class="clearfix"></div>
    <!-- e主内容 -->
  </div>
</section>
<!--e主内容-->
{/block}

{block name="js"}
<script src="__JS__/front/collect.js?version={$version}"></script>
<script>
{literal}
$(function(){
	$('.del-addr').click(function(event) {
		event.preventDefault();
		var item_id = $(this).siblings('#item_id').val();
		cancel_collect(item_id);
		$(this).parent().parent().remove();	
	});
});

{/literal}
</script>
{/block}
